#include" ../include/linkedlist.h"
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void insert(char name[], int index, struct linkedlist hashbucket[])
{

int found=0;
struct linkedlist *temp;

head=hashbucket[index];
temp=head;

		if(hashbucket[index]->name==NULL)
		{
			hashbucket[index]=(linkedlist*)malloc(sizeof(struct linkedlist));
			strcpy(hashbucket[index]->name,name);
			head=hashbucket[index];
			head->nextNode=NULL;
		}
		else
		{
			while(!found)
			{

			if(temp->nextNode==NULL)
			{
			found=1;
			head=hashbucket[index];
			hashbucket[index]=(linkedlist*)malloc(sizeof(struct linkedlist));
			strcpy(hashbucket[index]->name,name);
			hashbucket[index]->nextNode=head;
			}
			else
			{
			temp=temp->nextNode;
			}
			}
		}
}

